@()(implicit request: RequestHeader)
@main("预测")("predict") {
	<style>
			.icon2x {
				width: 24px;
				font-size: 20px;
				min-width: 24px;
				display: inline-block;
			}

			.borders {
				width: 400px;
				height: 300px;
				border: 1px solid #333333;
				border-radius: 10px 10px 10px 10px;
				margin: 30px 30px 30px 30px;
				float: left;
			}

			row .logo {
				width: 48px;
				float: left;
				margin-top: 10px;
			}

			row .title {
				height: 36px;
				position: relative;
				word-break: break-all;
				margin-left: 45px;
			}

			row .name {
				font-size: 20px;
				position: absolute;
				top: 50%;
				left: 0;
				transform: translateY(-50%);
			}

			a.disabled {
				pointer-events: none;
				cursor: default;
				opacity: .65
			}

			.name1 {
				font-size: 18px;
			}

	</style>


	<div class="page-content">

		<div class="page-bar">
			<ul class="page-breadcrumb">
				<li>
					<i class="fa fa-picture-o"></i>
					<a href="#">预测</a>
				</li>
			</ul>
		</div>

		<div class="row-fluid">

			<div class="row">
				<div class="col-md-12 col-sm-12">
					<div class="portlet green-jungle box">
						<div class="portlet-title">
							<div class="caption">
								设置参数
							</div>
						</div>

						<div class="portlet-body">

							<form class="registration-form form-horizontal" id="form"
							accept-charset="UTF-8" method="post">

								<div class="form-group">
									<label class="control-label col-sm-2">样本号:</label>
									<div class="col-sm-3">
										<input class="form-control" value="12345" name="sampleId" id="sampleId">
									</div>
									<label class="control-label col-sm-2">姓名:</label>
									<div class="col-sm-3">
										<input class="form-control" value="绘云" name="name" id="name">
									</div>
								</div>


								<div class="form-group">
									<label class="control-label col-sm-2">年龄 (18岁及以上):</label>
									<div class="col-sm-3">
										<div class="input-group">
											<span class="input-group-btn">
												<button class="btn btn-default" onclick="reduceNum(this)" type="button">
													-</button></span><input type="text" class="form-control" value="30" name="age" id="age"><span class="input-group-btn">
											<button class="btn btn-default" onclick="addNum(this)" type="button">
												+</button></span>
										</div>
									</div>
									<label class="control-label col-sm-2">天门冬氨酸氨基转移酶 (U/L，0～1000):</label>
									<div class="col-sm-3">
										<div class="input-group ">
											<span class="input-group-btn">
												<button class="btn btn-default" onclick="reduceNum(this)" type="button">
													-</button></span><input type="text" class="form-control" value="100" name="ast" id="ast"><span class="input-group-btn">
											<button class="btn btn-default" onclick="addNum(this)" type="button">
												+</button></span>
										</div>
									</div>
								</div>

								<div class="form-group">
									<label class="control-label col-sm-2">丙氨酸氨基转移酶 (U/L，0～2000):</label>
									<div class="col-sm-3">
										<div class="input-group ">
											<span class="input-group-btn">
												<button class="btn btn-default" onclick="reduceNum(this)" type="button">
													-</button></span><input type="text" class="form-control" value="200" name="alt" id="alt"><span class="input-group-btn">
											<button class="btn btn-default" onclick="addNum(this)" type="button">
												+</button></span>
										</div>
									</div>
									<label class="control-label col-sm-2">血小板计数 (10^9/L，0～1000):</label>
									<div class="col-sm-3">
										<div class="input-group ">
											<span class="input-group-btn">
												<button class="btn btn-default" onclick="reduceNum(this)" type="button">
													-</button></span><input type="text" class="form-control" value="100" name="plt" id="plt"><span class="input-group-btn">
											<button class="btn btn-default" onclick="addNum(this)" type="button">
												+</button></span>
										</div>
									</div>
								</div>

								<div class="form-group">
									<div class="actions col-sm-offset-2 col-sm-2">
										<button type="button" class="btn btn-primary" style="width: 90%;" id="myRun" onclick="myRunBefore()">
											运行</button>
									</div>

								</div>

							</form>

						</div>
					</div>
				</div>
			</div>

			@user.predictResult()


		</div>


	</div>


	<script>
			$(function () {

				bootstrapValidator()

			})

			function myRunBefore() {
				Predict.myRun

			}

			function reduceNum(element) {
				var textElement = $(element).parent().next()
				var value = $(textElement).val()
				$(textElement).val(parseInt(value) - 1)
			}

			function addNum(element) {
				var textElement = $(element).parent().prev()
				var value = $(textElement).val()
				$(textElement).val(parseInt(value) + 1)
			}

			function bootstrapValidator() {
				$('#form').bootstrapValidator({
					framework: 'bootstrap',
					icon: {
						valid: 'glyphicon glyphicon-ok',
						invalid: 'glyphicon glyphicon-remove',
						validating: 'glyphicon glyphicon-refresh'
					},
					fields: {
						sampleId: {
							validators: {
								notEmpty: {
									message: "样本号不能为空！"
								},

							}
						},
						age: {
							validators: {
								notEmpty: {
									message: "年龄不能为空！"
								},
								between: {
									min: 18,
									max: 100,
									message: "年龄必须处于18到100之间！"
								},

							}
						},
						ast: {
							validators: {
								notEmpty: {
									message: "天门冬氨酸氨基转移酶不能为空！"
								},
								between: {
									min: 0,
									max: 1000,
									message: "天门冬氨酸氨基转移酶必须处于0到1000之间！"
								},

							}
						},
						alt: {
							validators: {
								notEmpty: {
									message: "丙氨酸氨基转移酶不能为空！"
								},
								between: {
									min: 0,
									max: 2000,
									message: "丙氨酸氨基转移酶必须处于0到2000之间！"
								},

							}
						},
						plt: {
							validators: {
								notEmpty: {
									message: "血小板计数不能为空！"
								},
								between: {
									min: 0,
									max: 1000,
									message: "血小板计数必须处于0到1000之间！"
								},

							}
						},
					}

				});
			}




	</script>

}